<?php
/**
 * 软装设计
 */
namespace app\admin\controller;

use think\Request;
use app\admin\model\Quote as QuoteModel;

class Quote extends Base
{
    protected $model;

    public function __construct(Request $request = null)
    {
        parent::__construct($request);

        $this->model = new QuoteModel();
    }

    public function index()
    {
        $counts_page = 10;

        $counts = $this->model->count('id');

        $pages = intval(ceil($counts/$counts_page));

        $data = $this->model
            // ->field('id,cid,title,thumb,top,status,sort,clicks,mtime')
            ->order('id desc')
            ->paginate($counts_page, $counts);

        $this->assign('data', $data);
        $this->assign('counts', $counts);
        $this->assign('pages', $pages);
        $this->assign('district', $this->model->district);
        $this->assign('source', $this->model->source);
        return $this->fetch();
    }
}
